﻿using System;
using CodeCounsel.SharePoint.RibbonDesigner.Model;
using System.ComponentModel;

namespace CodeCounsel.SharePoint.RibbonDesigner.ViewModel
{
    public abstract class ControlViewModel<T>
        : DomainViewModel<T>
        where T: DomainElement
    {
        DisplayMode _displaymode;

        public DisplayMode DisplayMode
        {
            get { return _displaymode; }
            set
            {
                if (_displaymode != value)
                {
                    _displaymode = value;
                    OnPropertyChanged(new PropertyChangedEventArgs("DisplayMode"));
                }
            }
        }

        public ControlViewModel(T model, DisplayMode displayMode)
            : base(model)
        {
            _displaymode = displayMode;
        }
    }
}
